clear

use JCR_November2018_BiHsurvey.dta, clear
	
*Table 2 
mean MoreMoney MoreLegalAid MoreRecognition ethnocentric age EducationLevel
proportion Bosniak Serb Croat Women Unemployed Rural


*Table 5
mean WomenExtraBenefits WomenStigmatized WomenExperiencedCRSV FemaleEarningMoney
codebook WomenExtraBenefits WomenStigmatized WomenExperiencedCRSV FemaleEarningMoney

factor WomenExtraBenefits WomenStigmatized WomenExperiencedCRSV FemaleEarningMoney
predict femalestigma

mean MenExtraBenefits MenStigmatized MenNeedLessAssistance MenExperiencedCRSV MaleEarningMoney AwarenessAboutWomen DontTalkAboutMen
codebook MenExtraBenefits MenStigmatized MenNeedLessAssistance MenExperiencedCRSV MaleEarningMoney AwarenessAboutWomen DontTalkAboutMen

factor MenExtraBenefits MenStigmatized MenNeedLessAssistance MenExperiencedCRSV MaleEarningMoney AwarenessAboutWomen DontTalkAboutMen
predict malestigma

sum malestigma femalestigma
	
	
	
**********************************************************
*Table 6: Focus on money with legal aid and recongition in the appendix
**********************************************************
#delimit ;
reg MoreMoney MaleInfoMoney HomosexualsUnfavorable  [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreMoney1, word replace
di e(r2_a)


#delimit ;
reg MoreMoney MaleInfoMoney HomosexualsUnfavorable MaleInfoUnfavHomosexualMoney [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreMoney2, word replace
di e(r2_a)

#delimit ;
reg MoreMoney MaleInfoMoney HomosexualsUnfavorable MaleInfoUnfavHomosexualMoney 
malestigma femalestigma [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreMoney3, word replace
di e(r2_a)

#delimit ;
reg MoreMoney MaleInfoMoney HomosexualsUnfavorable MaleInfoUnfavHomosexualMoney 
malestigma femalestigma Rural Women ethnocentric EducationLevel Bosniak Serb age Unemployed [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreMoney4, word replace
di e(r2_a)


*Additional Appendix Tables 
***************************************************************
***************************************************************
#delimit ;
reg MoreLegalAid MaleInfoLegal HomosexualsUnfavorable [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreLegalAid1, word replace
di e(r2_a)

#delimit ;
reg MoreLegalAid MaleInfoLegal HomosexualsUnfavorable MaleInfoUnfavHomosexualLegal [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreLegalAid2, word replace
di e(r2_a)


#delimit ;
reg MoreLegalAid MaleInfoLegal HomosexualsUnfavorable MaleInfoUnfavHomosexualLegal
malestigma femalestigma [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreLegalAid3, word replace
di e(r2_a)


#delimit ;
reg MoreLegalAid MaleInfoLegal HomosexualsUnfavorable MaleInfoUnfavHomosexualLegal
malestigma femalestigma Rural Women ethnocentric EducationLevel Bosniak Serb age Unemployed [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreLegalAid, word replace
di e(r2_a)


***************************************************************
***************************************************************

#delimit ;
reg MoreRecognition MaleInfoRecognition HomosexualsUnfavorable  [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreRecognition1, word replace
di e(r2_a)

#delimit ;
reg MoreRecognition MaleInfoRecognition HomosexualsUnfavorable MaleInfoUnfavHomosexualRecogn  [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreRecognition2, word replace
di e(r2_a)	


#delimit ;
reg MoreRecognition MaleInfoRecognition HomosexualsUnfavorable MaleInfoUnfavHomosexualRecogn 
malestigma femalestigma  [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreRecognition3, word replace
di e(r2_a)	


#delimit ;
reg MoreRecognition MaleInfoRecognition HomosexualsUnfavorable MaleInfoUnfavHomosexualRecogn 
malestigma femalestigma Rural Women ethnocentric EducationLevel Bosniak Serb age Unemployed [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreRecognition4, word replace
di e(r2_a)	




*Table 7 
gen WomenFavor = femalevictimsdonation - malevictimsdonation

reg WomenFavor HomosexualsUnfavorable [pw=rim_w_1], robust
di e(r2_a)	
outreg2 using WomenFavor1, word replace

reg WomenFavor HomosexualsUnfavorable malestigma femalestigma [pw=rim_w_1], robust
di e(r2_a)	
outreg2 using WomenFavor2, word replace

reg WomenFavor HomosexualsUnfavorable malestigma femalestigma Rural Women ethnocentric EducationLevel Bosniak Serb age Unemployed [pw=rim_w_1], robust
di e(r2_a)	
outreg2 using WomenFavor3, word replace




*Figure 2 
#delimit ;
reg MoreMoney MaleInfoMoney HomosexualsUnfavorable MaleInfoUnfavHomosexualMoney 
malestigma femalestigma Rural Women ethnocentric EducationLevel Bosniak Serb age Unemployed [pw=rim_w_1], robust
;
#delimit cr
	outreg2 using MoreMoney4, word replace
di e(r2_a)



set more off

egen MLA_mean = mean(malestigma)
egen WEC_mean = mean(femalestigma)
egen BU_mean = mean(ethnocentric)
egen ED_mean = mean(EducationLevel)
egen WF_mean = mean(WomenFavor)
egen Age_mean = mean(age)

gen Control = 0
keep if _n==1
keep MLA_mean WEC_mean BU_mean ED_mean WF_mean Age_mean

		matrix def b = e(b)
		matrix def V = e(V)
		mat list b
		mat list V

set more off

	save CRSVIVs.dta, replace
	
	*program drop CRSVRegression
	
program define CRSVRegression
		use CRSVIVs.dta, clear
		
		*reg MoreMoney MaleInfoMoney MenLessAssistance WomenEarningChallenge Rural Serb 
*HomosexualsUnfavorable MaleInfoUnfavHomosexualMoney BosniaksUnfavorable EducationLevel WomenFavor age [pw=rim_w_1]
		

		drawnorm b1-b14, means(b) cov(V)
		*reg MoreMoney FemaleInfo SerbInfo FemaleSerbInteraction
		gen CRSVMaleInfoTol = b1*1 + b2*0 + b3*1*0 + b4*MLA_mean + b5*WEC_mean + b6*0 + b7*1 +  b8*BU_mean + b9*ED_mean + b10*1 + b11*0 + b12*Age_mean + b13*0 + b14
		gen CRSVFemaleInfoTol = b1*0 + b2*0 + b3*0*0 + b4*MLA_mean + b5*WEC_mean + b6*0 + b7*1 +  b8*BU_mean + b9*ED_mean + b10*1 + b11*0 + b12*Age_mean + b13*0 + b14
	    gen CRSVMaleInfoInTol  = b1*1 + b2*3 + b3*1*3 + b4*MLA_mean + b5*WEC_mean + b6*0 + b7*1 +  b8*BU_mean + b9*ED_mean + b10*1 + b11*0 + b12*Age_mean + b13*0 + b14
		gen CRSVFemaleInfoIntol = b1*0 + b2*3 + b3*0*3 + b4*MLA_mean + b5*WEC_mean + b6*0 + b7*1 +  b8*BU_mean + b9*ED_mean + b10*1 + b11*0 + b12*Age_mean + b13*0 + b14
		
	
	
	
	append using CRSV.dta
	save CRSV.dta, replace
			
			end
							
			clear
			save CRSV.dta, replace emptyok
	
			set more off
			*simulating
			simulate, reps(2000):  CRSVRegression

			use CRSV.dta, clear
			
set more off

#delimit ; 
collapse (mean)
CRSVMaleInfoTol CRSVFemaleInfoTol CRSVMaleInfoInTol CRSVFemaleInfoIntol  
(sd)
CRSVMaleInfoTol_sd=CRSVMaleInfoTol 
CRSVFemaleInfoTol_sd=CRSVFemaleInfoTol 
CRSVMaleInfoInTol_sd=CRSVMaleInfoInTol 
CRSVFemaleInfoIntol_sd=CRSVFemaleInfoIntol 
 ;
#delimit cr 

browse

gen CRSVMaleInfoTol_hi = CRSVMaleInfoTol + 1.96*CRSVMaleInfoTol_sd
gen CRSVMaleInfoTol_lo = CRSVMaleInfoTol - 1.96*CRSVMaleInfoTol_sd

gen CRSVFemaleInfoTol_hi = CRSVFemaleInfoTol + 1.96*CRSVFemaleInfoTol_sd
gen CRSVFemaleInfoTol_lo = CRSVFemaleInfoTol - 1.96*CRSVFemaleInfoTol_sd

gen CRSVMaleInfoInTol_hi = CRSVMaleInfoInTol + 1.96*CRSVMaleInfoInTol_sd
gen CRSVMaleInfoInTol_lo = CRSVMaleInfoInTol - 1.96*CRSVMaleInfoInTol_sd

gen CRSVFemaleInfoIntol_hi = CRSVFemaleInfoIntol + 1.96*CRSVFemaleInfoIntol_sd
gen CRSVFemaleInfoIntol_lo = CRSVFemaleInfoIntol - 1.96*CRSVFemaleInfoIntol_sd

graph set window fontface "Times New Roman"

gen axis_1 = 1
gen axis_2 = 2
gen axis_3 = 3
gen axis_4 = 4

lab def CRSVdotplot 1 "MaleSurvivor" 2 "FemaleSurvivor" 3 "MaleSurvivor" 4 "FemaleSurvivor"   
label val axis_1 CRSVdotplot 


#delimit ;
twoway 

		(bar CRSVMaleInfoInTol axis_1, 
			color(black) barwidth(.35) msize(large))
		(rcap CRSVMaleInfoInTol_lo CRSVMaleInfoInTol_hi axis_1,
			lcolor(gs10))

	    (bar CRSVFemaleInfoIntol axis_2, 
			color(black) barwidth(.35) msize(large))
		(rcap CRSVFemaleInfoIntol_lo CRSVFemaleInfoIntol_hi axis_2,
			lcolor(gs10))

		(bar CRSVMaleInfoTol axis_3, 
			color(gs10) barwidth(.35) msize(large))
		(rcap CRSVMaleInfoTol_lo CRSVMaleInfoTol_hi axis_3,
			lcolor(black))
						
		(bar CRSVFemaleInfoTol axis_4, 
			color(gs10) barwidth(.35) msize(large))
		(rcap CRSVFemaleInfoTol_lo CRSVFemaleInfoTol_hi axis_4,
			lcolor(black))	
					
		,
legend(off)
ylabel(4(2)8)
ytitle("Expected value of agreement with stipends")
note("Figure 2: Agreeing that sexual violence survivors should receive a stipend" 
"by treatment groups and homophobia with 95 percent CIs." 
"Homophobic respondents (black) and tolerant respondents (grey)"
"Data source: 2018 Survey of Bosnia and Herzegovina." 
"Agreement: 0(Strongly disagree) - 10(Strongly agree)", size(medsmall))
xlabel(#3,valuelabel angle(horizontal)) xsize(7) ysize(5.5) 
name(CRSVgraph, replace) 
scheme(s1mono)
;
#delimit cr

